#@ucenter_layout()
#define script()
<script>
    function doDelComment(id) {
        if (confirm("确定要删除这条评论吗？删除后不可恢复")) {
            ajaxGet("#(CPATH)/ucenter/article/doCommentDel?id=" + id)
        }
    }

</script>
#end

#define css()
<style>
    strong p {
        display: inline;
    }
</style>
#end

#define content()
<section class="content">

    <div class="container-fluid">
        <div class="card card-outline card-primary">

            <!-- /.card-header -->
            <div class="card-body p-0">

                <table class="table table-striped">
                    <tbody>
                    <tr>
                        <th style="width: 40%">内容</th>
                        <th>回复至</th>
                        <th style="width: 50px"><i class="fa fa-commenting"></i></th>
                        <th style="width: 90px">发布时间</th>
                        <th style="width: 60px">操作</th>
                    </tr>
                    #for(comment : page.list ??)
                    <tr>
                        <td>
                            #(comment.content ??)
                            <strong>
                                #if(comment.isUnaudited()) <span style="color:#007bff;">(待审核) </span>#end
                            </strong>
                        </td>
                        <td>
                            <a href="#(comment.article.url ??)" target="_blank">
                                #(comment.article.title ??)
                            </a>
                        </td>
                        <td>#(comment.comment_count ??)</td>
                        <td>#date(comment.created)</td>
                        <td><a style="color:#007bff;" href="javascript:;" onclick="doDelComment('#(comment.id)')">删除</a></td>
                    </tr>
                    #else
                    <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                    #end

                    </tbody>
                </table>
            </div>
            <!-- /.card-body -->
            <div class="card-footer">
                <div class="row">
                    <div class="col-sm-12">
                        #@_paginate()
                    </div>
                </div>
            </div>
            <!-- /.card-footer -->
        </div>
        <!-- /.card -->
    </div>
</section>

#end
